<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title><?php global $title;echo $title;?></title>
<link rel="stylesheet" type="text/css" href="dist/semantic.min.css">
<link rel="stylesheet" type="text/css" href="dist/dropdown.min.css">
<script src="assets/script/jquery.min.js"></script>
<script src="assets/script/stucloud.js"></script>
<script src="dist/semantic.min.js"></script>
<script src="dist/dropdown.min.js"></script>
  <script src="assets/script/jquery.form.js"></script>
</head>
<body>
<style type="text/css">
body {
	background-color: #DADADA;
}

body>.grid {
	height: 100%;
}

.image {
	margin-top: 0px;
}

.column {
	max-width: 600px;
}

@media screen and (max-width: 600px) {
	.column {
		max-width: 90% !important;
		padding-top: 0px !important;
		padding-left: 0px !important;
		padding-right: 0px !important;
		padding-bottom: 0px !important;
	}
	.stumain {
		margin-top: 0px !important;
		margin-right: 0px !important;
		margin-left: 0px !important;
		margin-bottom: 0px !important;
	}
}
</style>
<script type="text/javascript">
function onSuccess(data){
	if (data.code==0) {
		window.location.href = "index.php";
		return;
	}else{
		showMessage("backMessage",data.code,"注册失败，服务器返回:" + data.message);
		$("#registerform").addClass("error").removeClass("success");
	}
}
function onError(data){
	showMessage("backMessage",-101,"注册失败，服务器返回未知数据，详情请见console  code:-101");
	$("#registerform").addClass("error").removeClass("success");
	console.log(data);
}
	$(document).ready(function() {
		$('.ui.form').form({
			fields: {
				name: {
					identifier: 'phone',
					rules: [{
						type: 'regExp[^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$]',
						prompt: '你输入的手机号无效'
					}]
				},
				email: {
					identifier: 'email',
					rules: [{
						type: 'email',
						prompt: '邮箱输入必须符合格式'
					}]
				},
				passwd: {
					identifier: 'passwd',
					rules: [{
						type: 'minLength[6]',
						prompt: '密码必须大于六位'
					},
					{
						type: 'empty',
						prompt: '密码不能为空'
					}]
				},
				conform: {
					identifier: 'conform',
					rules: [{
						type: 'match[passwd]',
						prompt: '两次输入的密码必须一致'
					},
					{
						type: 'empty',
						prompt: '确认密码不能为空'
					}]
				},
				agreement: {
					identifier: 'agreement',
					rules: [{
						type: 'checked',
						prompt: '您必须同意我们的协议后才能继续'
					}]
				}
			}
		});
		bindAjaxForm($("#registerform"),onSuccess,onError,"dimmer");
		$(".ui.icon.message").hide();
		$("#backmess").hide();
		$("form").submit(function(e) {});
		$('.ui.checkbox').checkbox();
	});
  </script>
	<div class="ui modal">
		<i class="close icon"></i>
		<div class="header">学生云系统用户服务条款</div>
		<div class="scrolling content">
			<div class="description">
				<p>在您使用学生云系统之前，您必须了解下面的服务条款，并同意遵守。</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
				<p>条款1，禁止发表违法言论</p>
			</div>
		</div>
		<div class="actions">
			<div class="ui negative button" onClick="closeWindow();">我拒绝</div>
			<div class="ui positive button" onClick="$('.agreementBox').click();">我同意</div>
		</div>
	</div>
	<div class="ui middle aligned center aligned grid stumain">
		<div class="column">
			<form class="ui form" id="registerform" url="index.php?mod=register&op=register&ajax=true">
				<input type="hidden" name="op" value="register"> <input
					type="hidden" name="mod" value="register">
				<div class="ui attached message">
					<h2 class="ui image header">学生云系统</h2>
					<br />
					<div class="header">欢迎来到StuCloud</div>
					<p>
						这里是第一步，请在这里填写您的登录相关的信息。<br />并请阅读我们的服务条款<a href="#"
							onClick="$('.ui.modal').modal('show');">（点击这里）</a>
								已有账户？<a href="index.php?mod=login">点击登录;</a>
					</p>
				</div>
				<div class="ui stacked attached segment">
				<div class="ui dimmer" id="dimmer">
						<div class="ui text loader">注册中</div>
					</div>
					<br />
					<div class="field">
						<div class="ui left icon input">
							<i class="mail icon"></i> <input type="text" name="email"
								placeholder="电子邮箱地址">
						</div>
					</div>
					<div class="field">
						<div class="ui left icon input">
							<i class="user icon"></i> <input type="text" name="phonenumber"
								placeholder="手机号码">
						</div>
					</div>
					<div class="field">
						<div class="ui left icon input">
							<i class="lock icon"></i> <input type="password" name="passwd"
								placeholder="密码">
						</div>
					</div>
					<div class="field">
						<div class="ui left icon input">
							<i class="lock icon"></i> <input type="password" id="conform"
								name="conform" placeholder="确认密码">
						</div>
					</div>
					<div class="inline field">
						<div class="ui checkbox agreementBox">

							<input type="checkbox" name="agreement" tabindex="0"
								class="hidden"> <label>我同意学生云系统的服务条款</label>
						</div>
					</div>

					<div class="ui fluid large submit button">注册</div>
				</div>
				<div class="ui error message" id="backMessage"></div>
			</form>
		</div>
	</div>

</body>

</html>
